import java.util.Scanner;

public class Test {
    /**
     * 作业
     */
    //求1！+2！+3！+4！+........+n!的和
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num= scanner.nextInt();
        int a=Sum (num);
        System.out.println(a);
    }

    public static int Sum(int num){
        int sum =0;
        for(int i =1; i<=num;i++){
            int ret =1;
            for(int j =1; j<=i; j++){
                ret *= j;
            }
            sum+=ret;
        }
        return sum;
    }




    //输出一个整数的每一位，如：123的每一位是3，2，1
   /* public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
             print (num);

    }

    public static void print(int num) {

        while (num != 0) {
            System.out.println(num % 10);
            num /= 10;

        }
    }*/
}
